package com.ruoyi.site.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 用户认证/多渠道登录对象 user_auths
 *
 * @author chuckeytang
 * @date 2025-10-13
 */
public class UserAuths extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 认证ID */
    private Long authId;

    /** 外键，关联 users 表 */
    @Excel(name = "用户ID")
    private Long userId;

    /** 登录类型 (如: email, google, facebook) */
    @Excel(name = "登录类型")
    private String identityType;

    /** 登录标识 (如: 邮箱地址, 第三方ID) */
    @Excel(name = "登录标识")
    private String identifier;

    /** 凭证 (如: 加密密码, OAuth Refresh Token) */
    private String credential;

    /** 是否已验证 (例如邮箱) */
    @Excel(name = "是否已验证", readConverterExp = "0=否,1=是")
    private Integer isVerified;

    /** 该渠道最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastLoginAt;

    /** 记录创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /** 记录更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    // Getter and Setter methods... (省略，假设由 Lombok @Data 或 IDE 生成)

    public Long getAuthId() {
        return authId;
    }

    public void setAuthId(Long authId) {
        this.authId = authId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getIdentityType() {
        return identityType;
    }

    public void setIdentityType(String identityType) {
        this.identityType = identityType;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getCredential() {
        return credential;
    }

    public void setCredential(String credential) {
        this.credential = credential;
    }

    public Integer getIsVerified() {
        return isVerified;
    }

    public void setIsVerified(Integer isVerified) {
        this.isVerified = isVerified;
    }

    public Date getLastLoginAt() {
        return lastLoginAt;
    }

    public void setLastLoginAt(Date lastLoginAt) {
        this.lastLoginAt = lastLoginAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("authId", getAuthId())
                .append("userId", getUserId())
                .append("identityType", getIdentityType())
                .append("identifier", getIdentifier())
                .append("isVerified", getIsVerified())
                .append("lastLoginAt", getLastLoginAt())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .toString();
    }
}